home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6511 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1003 b 

  1. Path: access4.digex.net!not-for-mail
  2. From: ell@access4.digex.net (Ell)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Pure Virtual Destructor Question
  5. Date: 9 Feb 1996 02:50:40 GMT
  6. Organization: The Universe
  7. Message-ID: <4fecq0$k4e@news4.digex.net>
  8. References: <4fas7a$7ns@comet2.magicnet.net>
  9. NNTP-Posting-Host: access4.digex.net
  10. X-Newsreader: TIN [UNIX 1.3 950824BETA PL0]
  11.  
  12. Jody Hagins (gamecox@magicnet.magicnet.net) wrote:
  13. : Assume a class Foo s.t.
  14. : class Foo
  15. : {
  16. : public:
  17. :   virtual ~Foo() = 0;
  18. : };
  19. : inline Foo::~Foo()
  20. : {
  21. :   // do some destructor stuff
  22. : }
  23.  
  24. Immediately above you are logically "defining" your "pure virtual" 
  25. destructor "inside the class where it is "declared" as a pure virtual
  26. function.  It is _illegal_ to logically, or physically "define" a pure
  27. virtual function in the class it is "declared" in.  A pure virtual should
  28. only be defined in classes derived from the class where the pure virtual
  29. is declared.  Only derived classes should "do some destructor stuff".
  30.  
  31. Elliott
  32.